/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package smartgrid;

/**
 *
 * @author claudio
 */
public class RankingElem implements Comparable<RankingElem>{
    
    String uID;
    Double valor;

    public RankingElem(String uID, Double valor) {
        this.uID = uID;
        this.valor = valor;
    }

    public String getuID() {
        return uID;
    }

    public void setuID(String uID) {
        this.uID = uID;
    }

    public Double getValor() {
        return valor;
    }

    public void setValor(Double valor) {
        this.valor = valor;
    }
    
     @Override
    public int compareTo(RankingElem r){
        int IGUAL = 0;
        int MENOR = 1;
        int MAIOR = -1;
        
        if (this.valor == r.getValor())
            return IGUAL;
        
        if (this.valor > r.getValor())
            return MAIOR;
        else
            return MENOR;
     }
}
